package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/api/apis"
	"tuowei.com/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, registerApiTestExercisesRouter)
}

func registerApiTestExercisesRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.ApiTestExercises{}
	v1.Use(authMiddleware.MiddlewareFunc()).Use(middleware.CheckLogin)
	//获取测试练习题列表（章，节）
	v1.GET("/exercises/test/list", api.GetQuestionBankList)
	// 练习题章节
	v1.GET("/exercises/detail/:id", api.Detail)
	v1.POST("/exercises/start/answer", api.StartAnswer)
	v1.GET("/exercises/type", api.GetQuestionTypeList)
	v1.GET("/exercise/subject/list", api.GetPracticeList)
	v1.GET("/exercises/achievement/report", api.GetAchievementReport)
	v1.POST("/exercises/submit", api.Submit)
	v1.POST("/exercises/againAnswer", api.AgainAnswerQuestion)
	// 练习题做完提交
	v1.POST("/exercises/next", api.NextQuestion)
	v1.POST("/leave/practice", api.RecordPracticeLeave)
}
